package com.hnucm.house.model;

import android.os.Build;

import androidx.annotation.RequiresApi;

import com.hnucm.house.base.BaseModel;
import com.hnucm.house.bean.NewHouseData;
import com.hnucm.house.contract.NewHouseCon;

import java.util.ArrayList;
import java.util.List;

import io.reactivex.Observable;

public class NewHouseModel extends BaseModel implements NewHouseCon.INewHouseModel {

    @RequiresApi(api = Build.VERSION_CODES.N)
    @Override
    public Observable<List<NewHouseData.DataDTO>> loadNewHouse() {
        return mApiServer.loadNewHouse()
                .map(newHouseData -> {
                    List<NewHouseData.DataDTO> list = new ArrayList<>(newHouseData.getData());
                    return list;
                });
    }

    @Override
    public Observable<List<NewHouseData.DataDTO>> refreshNewHouse() {
        return null;
    }
}
